package org.elec.mac.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;

@Slf4j
@Controller
public class PayController {

    private String appid;

    @RequestMapping(value = "/pay.do")
    private String myHandler(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws IOException {

        String code_url = request.getParameter("code_url");
        String mach = request.getParameter("mach");
        String accesstoken = request.getParameter("accesstoken");
        String orderid = request.getParameter("orderid");

        model.put("code_url", code_url);
        model.put("mach", mach);
        model.put("accesstoken", accesstoken);
        model.put("orderid", orderid);
        return "pay";
    }

}